﻿# common variables
@coa_width = 768
@coa_height = 512
@canton_scale_cross_x = @[ ( 333 / coa_width ) + 0.001 ]
@canton_scale_cross_y = @[ ( 205 / coa_height ) + 0.001 ]
@canton_scale_sweden_x = @[ ( 255 / coa_width ) + 0.001 ]
@canton_scale_sweden_y = @[ ( 204 / coa_height ) + 0.001 ]
@canton_scale_norway_x = @[ ( 192 / coa_width ) + 0.001 ]
@canton_scale_norway_y = @[ ( 192 / coa_height ) + 0.001 ]
@canton_scale_denmark_x = @[ ( 220 / coa_width ) + 0.001 ]
@canton_scale_denmark_y = @[ ( 220 / coa_height ) + 0.001 ]
@third = @[1/3]

ARG = { # Argentina
	flag_definition = {
		coa = ARG
		subject_canton = ARG
		coa_with_overlord_canton = ARG_subject
		allow_overlord_canton = yes		
		priority = 1
	}
	flag_definition = {
		coa = ARG_republic
		subject_canton = ARG_republic
		coa_with_overlord_canton = ARG_subject
		allow_overlord_canton = yes			
		priority = 10
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = ARG_dictatorship
		subject_canton = ARG_dictatorship
		coa_with_overlord_canton = ARG_subject
		allow_overlord_canton = yes			
		priority = 20
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = ARG_absolute_monarchy
		subject_canton = ARG_absolute_monarchy
		coa_with_overlord_canton = ARG_subject
		allow_overlord_canton = yes
		priority = 20
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = ARG_communist
		subject_canton = ARG_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = ARG_subject_SPA
		priority = 30
		trigger = { 
			coa_def_spanish_ensign_trigger = yes
		}
	}	
	flag_definition = {
		coa = ARG_fascist
		subject_canton = ARG_fascist
		coa_with_overlord_canton = ARG_subject
		allow_overlord_canton = yes
		priority = 1500
		trigger = { 
			coa_def_fascist_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = ARG_subject_USA		
		priority = 50
		trigger = { 
			coa_def_american_ensign_trigger = yes
		}
	}	
	
	## WB originals
	
	flag_definition = {
		coa = ARG_confederation
		subject_canton = ARG_confederation
		allow_overlord_canton = yes		
		coa_with_overlord_canton = ARG_subject
		priority = 26
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = {
				has_technology_researched = nationalism
			}
		}
	}
	
	flag_definition = {
		coa = ARG_world_cup
		subject_canton = ARG_republic
		coa_with_overlord_canton = ARG_subject
		allow_overlord_canton = yes			
		priority = 11
		trigger = {
			coa_def_republic_flag_trigger = yes
			NOT = { has_game_rule = WB_no_extra_fluff }
			
			exists = scope:actor
			scope:actor = {
				has_technology_researched = organized_sports
			}
		}
	}
	
	flag_definition = {
		coa = ARG_dictatorship
		subject_canton = ARG_dictatorship
		coa_with_overlord_canton = ARG_subject
		allow_overlord_canton = yes			
		priority = 21
		trigger = {
			exists = scope:actor
			scope:actor = { has_government_type = gov_junta }
		}
	}
	
	# Argentine War Flags
	
	flag_definition = {
		coa = ARG_dictatorship_war
		subject_canton = ARG_confederation
		allow_overlord_canton = yes		
		coa_with_overlord_canton = ARG_subject
		priority = 50
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
			
			coa_def_war_trigger = yes
		}
	}
	
	flag_definition = {
		coa = ARG_monarchy_war
		subject_canton = ARG_monarchy_war
		allow_overlord_canton = yes		
		coa_with_overlord_canton = ARG_subject
		priority = 50
		trigger = {
			OR = {
				coa_def_monarchy_flag_trigger = yes
				coa_def_absolute_monarchy_flag_trigger = yes
			}
			
			coa_def_war_trigger = yes
		}
	}
	
	flag_definition = {
		coa = ARG_communist_war
		subject_canton = ARG_communist_war
		allow_overlord_canton = yes		
		coa_with_overlord_canton = ARG_subject
		priority = 1505
		trigger = {
			coa_def_communist_flag_trigger = yes = yes
			
			coa_def_war_trigger = yes
		}
	}
	
	flag_definition = {
		coa = ARG_anarchist_war
		subject_canton = ARG_anarchist
		priority = 1506
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
			
			coa_def_war_trigger = yes
		}
	}
	flag_definition = {
		coa = ARG_republic_war
		subject_canton = ARG_republic
		allow_overlord_canton = yes		
		coa_with_overlord_canton = ARG_subject
		priority = 50
		trigger = {
			coa_def_republic_flag_trigger = yes
			
			coa_def_war_trigger = yes
		}
	}
	
	# WB anarchist flags
	flag_definition = {
		coa = ARG_anarchist
		subject_canton = ARG_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
	
	# Something Paradox never bothered to add a trigger to
	
	flag_definition = {
		coa = ARG_welsh
		subject_canton = ARG_welsh
		priority = 100
		trigger = {
			OR = {
				coa_def_welsh_ensign_trigger = yes
		
				AND = {
					exists = c:ARG
					c:ARG = {
						ruler = { has_culture = cu:welsh }
					}
				}
			}
		}
	}
}

BRZ = { # Brazil
	flag_definition = {
		coa = BRZ
		subject_canton = BRZ
		allow_overlord_canton = yes	
		coa_with_overlord_canton = BRZ_subject			
		priority = 1
	}
	flag_definition = {
		coa = BRZ_republic
		subject_canton = BRZ_republic	
		priority = 10
		trigger = { 
			coa_def_republic_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = BRZ_dictatorship
		subject_canton = BRZ_dictatorship			
		priority = 20
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = BRZ_communist
		subject_canton = BRZ_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = BRZ_fascist
		subject_canton = BRZ_fascist
		priority = 1500
		trigger = { 
			coa_def_fascist_flag_trigger = yes
		}
	}		
	flag_definition = {
		coa = BRZ_subject_GBR
		allow_overlord_canton = yes		
		priority = 50
		trigger = { 
			coa_def_british_ensign_trigger = yes
		}
	}	
	flag_definition = {
		coa = BRZ_subject_USA
		allow_overlord_canton = yes	
		overlord_canton_scale = { 0.5 0.54 }	
		priority = 50
		trigger = { 
			coa_def_american_ensign_trigger = yes
		}
	}

	# WB anarchist flags
	flag_definition = {
		coa = BRZ_anarchist
		subject_canton = BRZ_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}	
	
	flag_definition = {
		coa = BRZ_theocracy
		subject_canton = BRZ_theocracy
		priority = 10
		trigger = { 
			coa_def_theocracy_flag_trigger = yes
		}
	}
}

## Colombia ##

CLM = { # Colombia
	flag_definition = {
		coa = CLM
		subject_canton = CLM
		allow_overlord_canton = yes		
		coa_with_overlord_canton = CLM_subject			
		priority = 1
	}
	flag_definition = {
		coa = CLM_dictatorship
		subject_canton = CLM_dictatorship
		allow_overlord_canton = yes		
		coa_with_overlord_canton = CLM_subject
		priority = 20
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = CLM_oligarchy
		subject_canton = CLM_oligarchy
		allow_overlord_canton = yes		
		coa_with_overlord_canton = CLM_subject
		priority = 25
		trigger = {
			coa_def_oligarchy_flag_trigger = yes
		}
	}	
	flag_definition = {
		coa = CLM_communist
		subject_canton = CLM_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}		
	flag_definition = {
		coa = CLM_subject_SPA
		subject_canton = CLM_subject_SPA
		priority = 50
		trigger = { 
			coa_def_spanish_ensign_trigger = yes
		}
	}	
	flag_definition = {
		coa = CLM_subject_MEX
		subject_canton = CLM_subject_MEX
		priority = 30
		trigger = { 
			coa_def_mexican_ensign_trigger = yes
		}
	}	
	
	# WB originals
	
	flag_definition = {
		coa = CLM_monarchy
		subject_canton = CLM_monarchy
		allow_overlord_canton = yes		
		coa_with_overlord_canton = CLM_subject
		priority = 10
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = CLM_absolute_monarchy
		subject_canton = CLM_absolute_monarchy
		allow_overlord_canton = yes		
		coa_with_overlord_canton = CLM_subject
		priority = 15
		trigger = { 
			coa_def_absolute_monarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = CLM_modern
		subject_canton = CLM_modern
		priority = 20
		allow_overlord_canton = yes		
		coa_with_overlord_canton = CLM_subject
		
		trigger = {
			coa_def_republic_flag_trigger = yes
			exists = scope:actor
			scope:actor = {
				NOR = {
					has_law = law_type:law_legacy_slavery
					has_law = law_type:law_slave_trade
				}
			}
		}
	}
	
	flag_definition = {
		coa = CLM_estados_unidos
		subject_canton = CLM_estados_unidos
		allow_overlord_canton = yes		
		coa_with_overlord_canton = CLM_subject
		priority = 25
		trigger = {
			coa_def_dictatorship_flag_trigger = yes
			
			exists = scope:actor
			scope:actor = {
				has_technology_researched = nationalism
			}
		}
	}
	
	# WB anarchist flags
	flag_definition = {
		coa = CLM_anarchist
		subject_canton = CLM_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}
}

## Gao-Para ##

PRA = {
	flag_definition = {
		coa = PRA
		subject_canton = PRA
		allow_overlord_canton = yes	
		coa_with_overlord_canton = PRA_subject
		priority = 1
	}
		
	flag_definition = {
		coa = PRA_communist
		subject_canton = PRA_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}	
	
	flag_definition = {
		coa = PRA
		subject_canton = PRA
		priority = 20
		trigger = { 
			coa_def_brazilian_ensign_trigger = yes
		}
	}	
	
	flag_definition = {
		coa = PRA_monarchy
		subject_canton = PRA_monarchy
		allow_overlord_canton = yes	
		coa_with_overlord_canton = PRA_subject
		priority = 10
		
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
		}
	}

	# WB anarchist flags
	flag_definition = {
		coa = PRA_anarchist
		subject_canton = PRA_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}	
}

## Piratini ##

PNI = {
	flag_definition = {
		coa = PNI
		subject_canton = PNI
		allow_overlord_canton = yes			
		coa_with_overlord_canton = PNI_subject
		priority = 1
	}
		
	flag_definition = {
		coa = PNI_communist
		subject_canton = PNI_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}	
	
	flag_definition = {
		coa = PNI_BRZ_subject
		subject_canton = PNI_BRZ_subject
		priority = 20
		trigger = { 
			coa_def_brazilian_ensign_trigger = yes
		}
	}	
	
	flag_definition = {
		coa = PNI_monarchy
		subject_canton = PNI_monarchy
		allow_overlord_canton = yes	
		coa_with_overlord_canton = PRA_subject
		priority = 10
		
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
		}
	}

	# WB anarchist flags
	flag_definition = {
		coa = PNI_anarchist
		subject_canton = PNI_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}	
}

## Gran Colombia placeholder

GCO = { # Gran Colombia
	flag_definition = {
		coa = CLM_gran_colombia
		subject_canton = CLM_gran_colombia
		priority = 1
	}
	
	# WB originals
	
	flag_definition = {
		coa = GCO_monarchy
		subject_canton = GCO_monarchy
		priority = 10
		
		trigger = { 
			coa_def_monarchy_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = GCO_dictatorship
		subject_canton = GCO_dictatorship
		priority = 30
		trigger = { 
			coa_def_dictatorship_flag_trigger = yes
		}
	}
	
	flag_definition = {
		coa = GCO_communist
		subject_canton = GCO_communist
		priority = 1500
		trigger = { 
			coa_def_communist_flag_trigger = yes
		}
	}

	flag_definition = {
		coa = CLM_anarchist
		subject_canton = CLM_anarchist
		priority = 1501
		trigger = { 
			coa_def_anarchy_flag_trigger = yes
		}
	}	
}